<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="Common.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <Style x:Key="MainChromeBorder" TargetType="{x:Type Border}" >
        <Setter Property="BorderBrush" Value="{StaticResource NormalBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
    </Style>

    <Style TargetType="{x:Type CheckBox}">
        <Setter Property="Foreground" Value="{StaticResource ForegroundBrush}"/>
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="VerticalContentAlignment" Value="Top"/>
        <Setter Property="Margin" Value="5" />
        <Setter Property="Height" Value="15" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="CheckBox">
                    <BulletDecorator Background="Transparent">
                        <BulletDecorator.Bullet>
                            <Border x:Name="MainBorder"
                                    Width="15"
                                    Height="15"
                                    Style="{StaticResource MainChromeBorder}"
                                    Background="{StaticResource NormalBrush}">
                                <Path x:Name="CheckMark"
                                      Width="15"
                                      Height="15"
                                      SnapsToDevicePixels="False"
                                      Stroke="{StaticResource ForegroundBrush}"
                                      StrokeThickness="2"
                                      Data="M 2 5 L 4 10 10 2" />
                                <Border.RenderTransform>
                                    <RotateTransform x:Name="OverBorderRotateTransform" 
                                                 CenterX="7" 
                                                 CenterY="7" />
                                </Border.RenderTransform>
                            </Border>
                        </BulletDecorator.Bullet>
                        <ContentPresenter
                            Margin="4,0,0,0"
                            VerticalAlignment="Center"
                            HorizontalAlignment="Left"
                            RecognizesAccessKey="True"/>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="Common">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation
                                            From="-5" 
                                            To="5"
                                            AutoReverse="True" 
                                            Duration="0:00:00.3" 
                                            Storyboard.TargetName="OverBorderRotateTransform" 
                                            Storyboard.TargetProperty="Angle"
                                            RepeatBehavior="Forever" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimation 
                                            From="0" 
                                            To="360" 
                                            AutoReverse="True" 
                                            Duration="0:00:00.4" 
                                            Storyboard.TargetName="OverBorderRotateTransform" 
                                            Storyboard.TargetProperty="Angle" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                    </BulletDecorator>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="false">
                            <Setter TargetName="CheckMark" Property="Visibility" Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="IsChecked" Value="{x:Null}">
                            <Setter TargetName="CheckMark" Property="Data" Value="M 0 7 L 7 0" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="MainBorder" Property="Background" Value="{StaticResource MouseOverBrush}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="MainBorder" Property="Background" Value="{StaticResource ActiveBrush}" />
                            <Setter TargetName="MainBorder" Property="BorderBrush" Value="{StaticResource ActiveBrush}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter TargetName="MainBorder" Property="Background" Value="{StaticResource DisabledBrush}" />
                            <Setter TargetName="MainBorder" Property="BorderBrush" Value="{StaticResource DisabledBrush}" />
                            <Setter Property="Foreground" Value="{StaticResource DisabledBrush}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type TextBox}">
        <Setter Property="Foreground" Value="{StaticResource ForegroundBrush}"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="OverridesDefaultStyle" Value="True"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
        <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
        <Setter Property="AllowDrop" Value="true"/>
        <Setter Property="Padding" Value="1"/>
        <Setter Property="Height" Value="22" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TextBoxBase}">
                    <Grid>
                        <Border x:Name="MainBorder"
                                Style="{StaticResource MainChromeBorder}">
                            <ScrollViewer x:Name="PART_ContentHost"
                                          SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                          VerticalContentAlignment="Center" />
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="MainBorder" Property="Background" Value="{StaticResource MouseOverBrush}" />
                            <Setter TargetName="MainBorder" Property="Opacity" Value="1" />
                        </Trigger>
                        <Trigger Property="IsKeyboardFocused" Value="True">
                            <Setter TargetName="MainBorder" Property="BorderBrush" Value="{StaticResource ActiveBrush}" />
                            <Setter TargetName="MainBorder" Property="Opacity" Value="1" />
                            <Setter TargetName="MainBorder" Property="Background" Value="{StaticResource ActiveBrush}" />
                            <Setter Property="Foreground" Value="{StaticResource WhiteBrush}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="MainBorder" Property="BorderBrush" Value="{StaticResource DisabledBrush}" />
                            <Setter Property="Foreground" Value="{StaticResource DisabledBrush}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type Button}">
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="HorizontalContentAlignment" Value="Center" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="Foreground" Value="{StaticResource ForegroundBrush}" />
        <Setter Property="Height" Value="22" />
        <Setter Property="Margin" Value="5" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid>
                        <Border x:Name="MainBorder"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Style="{StaticResource MainChromeBorder}" >
                            <ContentPresenter
                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                Margin="{TemplateBinding Padding}"
                                RecognizesAccessKey="True"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                            <Border.RenderTransform>
                                <RotateTransform x:Name="OverBorderRotateTransform" 
                                                 CenterX="25" 
                                                 CenterY="11" />
                            </Border.RenderTransform>
                        </Border>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="Common">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <!--<ColorAnimation 
                                            To="{StaticResource MouseOverColor}"
                                            Duration="0:00:1"
                                            Storyboard.TargetName="MainBorder"
                                            Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)"/>-->
                                        <DoubleAnimation
                                            From="-5" 
                                            To="5"
                                            AutoReverse="True" 
                                            Duration="0:00:00.3" 
                                            Storyboard.TargetName="OverBorderRotateTransform" 
                                            Storyboard.TargetProperty="Angle"
                                            RepeatBehavior="Forever" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimation 
                                            From="0" 
                                            To="360" 
                                            AutoReverse="True" 
                                            Duration="0:00:00.4" 
                                            Storyboard.TargetName="OverBorderRotateTransform" 
                                            Storyboard.TargetProperty="Angle" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="MainBorder" Property="Background" Value="{StaticResource MouseOverBrush}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="MainBorder" Property="BorderBrush" Value="{StaticResource ActiveBrush}" />
                            <Setter TargetName="MainBorder" Property="Background" Value="{StaticResource ActiveBrush}" />
                            <Setter Property="Foreground" Value="{StaticResource WhiteBrush}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="MainBorder" Property="BorderBrush" Value="{StaticResource DisabledBrush}" />
                            <Setter Property="Foreground" Value="{StaticResource DisabledBrush}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <ControlTemplate TargetType="{x:Type TextBox}" x:Key="ComboBoxTextBoxTemplate">
        <Border x:Name="PART_ContentHost" Background="{StaticResource WhiteBrush}" />
    </ControlTemplate>

    <ControlTemplate TargetType="{x:Type ToggleButton}" x:Key="ComboBoxToggleButtonTemplate">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition Width="16" />
            </Grid.ColumnDefinitions>
            <Border x:Name="MainBorder"
                    Style="{StaticResource MainChromeBorder}"
                    Background="{StaticResource NormalBrush}"
                    Grid.ColumnSpan="2" />
            <Border
                Margin="1"
                BorderThickness="0,0,1,0"
                Background="{StaticResource WhiteBrush}"
                Grid.Column="0" />
            <Path x:Name="Arrow"
                  Margin="0,0,3,0"
                  Data="M0,0L4,4 8,0z"
                  HorizontalAlignment="Center"
                  Fill="{StaticResource ForegroundBrush}"
                  VerticalAlignment="Center"
                  Width="8"
                  Grid.Column="1" />
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="UIElement.IsMouseOver" Value="True">
                <Setter Property="Panel.Background" TargetName="MainBorder" Value="{StaticResource MouseOverBrush}"/>
            </Trigger>
            <Trigger Property="ToggleButton.IsChecked" Value="True">
                <Setter Property="Panel.Background" TargetName="MainBorder" Value="{StaticResource ActiveBrush}"/>
                <Setter Property="Shape.Fill" TargetName="Arrow" Value="{StaticResource WhiteBrush}"/>
            </Trigger>
            <Trigger Property="UIElement.IsEnabled" Value="False">
                <Setter Property="Panel.Background" TargetName="MainBorder" Value="{StaticResource DisabledBrush}"/>
                <Setter Property="Border.BorderBrush" TargetName="MainBorder" Value="{StaticResource DisabledBrush}"/>
                <Setter Property="TextElement.Foreground" Value="{StaticResource DisabledBrush}"/>
                <Setter Property="Shape.Fill" TargetName="Arrow" Value="{StaticResource DisabledBrush}"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <Style TargetType="{x:Type ComboBoxItem}">
        <Setter Property="UIElement.SnapsToDevicePixels" Value="True"/>
        <Setter Property="FrameworkElement.FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="FrameworkElement.OverridesDefaultStyle" Value="True"/>
        <Setter Property="TextElement.Foreground" Value="{StaticResource ForegroundBrush}"/>
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ComboBoxItem}">
                    <Border x:Name="Border"
                            SnapsToDevicePixels="True"
                            Padding="1">
                        <ContentPresenter
                            ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}"
                            Content="{TemplateBinding ContentControl.Content}" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="ComboBoxItem.IsHighlighted" Value="True">
                            <Setter Property="Panel.Background" TargetName="Border" Value="{StaticResource MouseOverBrush}"/>
                            <Setter Property="TextElement.Foreground" Value="{StaticResource WhiteBrush}"/>
                        </Trigger>
                        <Trigger Property="ComboBoxItem.IsSelected" Value="True">
                            <Setter Property="Panel.Background" TargetName="Border" Value="{StaticResource ActiveBrush}"/>
                            <Setter Property="TextElement.Foreground" Value="{StaticResource WhiteBrush}"/>
                        </Trigger>
                        <Trigger Property="UIElement.IsEnabled" Value="False">
                            <Setter Property="TextElement.Foreground" Value="{StaticResource DisabledBrush}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="RightScrollViewer" TargetType="{x:Type ScrollViewer}">
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ScrollViewer}">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <Border
                            Grid.Column="0"
                            BorderThickness="1">
                            <ScrollContentPresenter />
                        </Border>
                        <Border
                            Grid.Column="1"
                            BorderBrush="{StaticResource ActiveBrush}"
                            BorderThickness="1 0 0 0"
                            Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}">
                            <ScrollBar x:Name="PART_VerticalScrollBar"
                                       Value="{TemplateBinding VerticalOffset}"
                                       Maximum="{TemplateBinding ScrollableHeight}"
                                       ViewportSize="{TemplateBinding ViewportHeight}"/>
                        </Border>
                        <ScrollBar x:Name="PART_HorizontalScrollBar"
                                   Orientation="Horizontal"
                                   Grid.Row="1"
                                   Grid.Column="0"
                                   Value="{TemplateBinding HorizontalOffset}"
                                   Maximum="{TemplateBinding ScrollableWidth}"
                                   ViewportSize="{TemplateBinding ViewportWidth}"
                                   Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type ComboBox}">
        <Setter Property="UIElement.SnapsToDevicePixels" Value="True"/>
        <Setter Property="FrameworkElement.FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="FrameworkElement.OverridesDefaultStyle" Value="True"/>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.CanContentScroll" Value="True"/>
        <Setter Property="TextElement.Foreground" Value="{StaticResource ForegroundBrush}"/>
        <Setter Property="Height" Value="22" />
        <Setter Property="Margin" Value="5" />
        <Setter Property="Padding" Value="-2" />
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ComboBox}">
                    <Grid>
                        <ToggleButton x:Name="ToggleButton"
                                      ClickMode="Press"
                                      IsChecked="{Binding Path=IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
                                      Focusable="False"
                                      Grid.Column="2"
                                      Template="{StaticResource ComboBoxToggleButtonTemplate}"/>
                        <ContentPresenter x:Name="ContentSite"
                                          Margin="3,3,23,3"
                                          HorizontalAlignment="Left"
                                          VerticalAlignment="Center"
                                          Content="{TemplateBinding SelectionBoxItem}"
                                          ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
                                          ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
                                          IsHitTestVisible="False" />
                        <TextBox x:Name="PART_EditableTextBox"
                                 Margin="3,3,23,3"
                                 Visibility="Hidden"
                                 HorizontalAlignment="Left"
                                 Background="Transparent"
                                 VerticalAlignment="Center"
                                 Style="{x:Null}"
                                 IsReadOnly="False"
                                 Focusable="True"
                                 xml:space="preserve"
                                 Template="{StaticResource ComboBoxTextBoxTemplate}"/>
                        <Popup x:Name="Popup"
                               Placement="Bottom"
                               Focusable="False"
                               AllowsTransparency="True"
                               IsOpen="{TemplateBinding ComboBox.IsDropDownOpen}"
                               PopupAnimation="Slide">
                            <Grid x:Name="DropDown"
                                  MinWidth="{TemplateBinding FrameworkElement.ActualWidth}"
                                  MaxHeight="{TemplateBinding ComboBox.MaxDropDownHeight}"
                                  SnapsToDevicePixels="True">
                                <Border x:Name="DropDownBorder"
                                        BorderBrush="{StaticResource ActiveBrush}"
                                        BorderThickness="1"
                                        Background="{StaticResource NormalBrush}"/>
                                <ScrollViewer Style="{StaticResource RightScrollViewer}"
                                    Margin="2 3"
                                    SnapsToDevicePixels="True">
                                    <ItemsPresenter KeyboardNavigation.DirectionalNavigation="Contained" />
                                </ScrollViewer>
                            </Grid>
                        </Popup>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="ItemsControl.HasItems" Value="False">
                            <Setter Property="FrameworkElement.MinHeight" TargetName="DropDownBorder" Value="95"/>
                        </Trigger>
                        <Trigger Property="UIElement.IsEnabled" Value="False">
                            <Setter Property="TextElement.Foreground" Value="{StaticResource DisabledBrush}"/>
                        </Trigger>
                        <Trigger Property="ItemsControl.IsGrouping" Value="True">
                            <Setter Property="ScrollViewer.CanContentScroll" Value="False"/>
                        </Trigger>
                        <Trigger Property="Window.AllowsTransparency" SourceName="Popup" Value="True">
                            <Setter Property="FrameworkElement.Margin" TargetName="DropDownBorder" Value="0,1,0,0"/>
                        </Trigger>
                        <Trigger Property="ComboBox.IsEditable" Value="True">
                            <Setter Property="KeyboardNavigation.IsTabStop" Value="False"/>
                            <Setter Property="UIElement.Visibility" TargetName="PART_EditableTextBox" Value="Visible"/>
                            <Setter Property="UIElement.Visibility" TargetName="ContentSite" Value="Hidden"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ScrollBarLineButton" TargetType="{x:Type RepeatButton}">
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="True"/>
        <Setter Property="Focusable" Value="false"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Border x:Name="Border"
                            Margin="1"
                            Background="{StaticResource NormalBrush}"
                            BorderThickness="1">
                        <Path x:Name="Arrow"
                              HorizontalAlignment="Center"
                              VerticalAlignment="Center"
                              Fill="{StaticResource ForegroundBrush}"
                              Data="{Binding Path=Content,RelativeSource={RelativeSource TemplatedParent}}" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="Border" Property="Background" Value="{StaticResource MouseOverBrush}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="Border" Property="Background" Value="{StaticResource ActiveBrush}" />
                            <Setter TargetName="Arrow" Property="Fill" Value="{StaticResource WhiteBrush}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter TargetName="Arrow" Property="Fill" Value="{StaticResource DisabledBrush}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ScrollBarPageButton" TargetType="{x:Type RepeatButton}">
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="IsTabStop" Value="false"/>
        <Setter Property="Focusable" Value="false"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Border Background="Transparent" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}">
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="IsTabStop" Value="false"/>
        <Setter Property="Focusable" Value="false"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Border x:Name="ThumbBorder"
                            Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="1" />
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="ThumbBorder" Property="Background" Value="{StaticResource MouseOverBrush}" />
                        </Trigger>
                        <Trigger Property="IsDragging" Value="true">
                            <Setter TargetName="ThumbBorder" Property="Background" Value="{StaticResource ActiveBrush}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <ControlTemplate x:Key="VerticalScrollBar" TargetType="{x:Type ScrollBar}">
        <Grid >
            <Grid.RowDefinitions>
                <RowDefinition MaxHeight="18"/>
                <RowDefinition Height="0.00001*"/>
                <RowDefinition MaxHeight="18"/>
            </Grid.RowDefinitions>
            <Border
                Grid.RowSpan="3"
                Background="{StaticResource WhiteBrush}" />
            <RepeatButton
                Grid.Row="0"
                Style="{StaticResource ScrollBarLineButton}"
                Height="18"
                Command="ScrollBar.LineUpCommand"
                Content="M 0 4 L 8 4 L 4 0 Z" />
            <Track x:Name="PART_Track"
                   Grid.Row="1"
                   IsDirectionReversed="true">
                <Track.DecreaseRepeatButton>
                    <RepeatButton
                        Style="{StaticResource ScrollBarPageButton}"
                        Command="ScrollBar.PageUpCommand" />
                </Track.DecreaseRepeatButton>
                <Track.Thumb>
                    <Thumb x:Name="ScrollBarThumb"
                           Style="{StaticResource ScrollBarThumb}"
                           Margin="1,0,1,0"
                           Background="{StaticResource NormalBrush}"
                           BorderBrush="{StaticResource NormalBrush}" />
                </Track.Thumb>
                <Track.IncreaseRepeatButton>
                    <RepeatButton
                        Style="{StaticResource ScrollBarPageButton}"
                        Command="ScrollBar.PageDownCommand" />
                </Track.IncreaseRepeatButton>
            </Track>
            <RepeatButton
                Grid.Row="2"
                Style="{StaticResource ScrollBarLineButton}"
                Height="18"
                Command="ScrollBar.LineDownCommand"
                Content="M 0 0 L 4 4 L 8 0 Z"/>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="IsEnabled" Value="false">
                <Setter Property="Foreground" Value="{StaticResource DisabledBrush}"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <ControlTemplate x:Key="HorizontalScrollBar" TargetType="{x:Type ScrollBar}">
        <Grid >
            <Grid.ColumnDefinitions>
                <ColumnDefinition MaxWidth="18"/>
                <ColumnDefinition Width="0.00001*"/>
                <ColumnDefinition MaxWidth="18"/>
            </Grid.ColumnDefinitions>
            <Border
              Grid.ColumnSpan="3"
              Background="#F0F0F0" />
            <RepeatButton 
              Grid.Column="0"                           
              Style="{StaticResource ScrollBarLineButton}"
              Width="18"
              Command="ScrollBar.LineLeftCommand"
              Content="M 4 0 L 4 8 L 0 4 Z" />
            <Track x:Name="PART_Track"
                   Grid.Column="1"
                   IsDirectionReversed="False">
                <Track.DecreaseRepeatButton>
                    <RepeatButton 
                      Style="{StaticResource ScrollBarPageButton}"
                      Command="ScrollBar.PageLeftCommand" />
                </Track.DecreaseRepeatButton>
                <Track.Thumb>
                    <Thumb 
                      Style="{StaticResource ScrollBarThumb}" 
                      Margin="0,1,0,1"  
                      Background="{StaticResource NormalBrush}"
                      BorderBrush="{StaticResource NormalBrush}" />
                </Track.Thumb>
                <Track.IncreaseRepeatButton>
                    <RepeatButton 
                      Style="{StaticResource ScrollBarPageButton}"
                      Command="ScrollBar.PageRightCommand" />
                </Track.IncreaseRepeatButton>
            </Track>
            <RepeatButton 
              Grid.Column="3" 
              Style="{StaticResource ScrollBarLineButton}"
              Width="18"
              Command="ScrollBar.LineRightCommand"
              Content="M 0 0 L 4 4 L 0 8 Z"/>
        </Grid>
    </ControlTemplate>

    <Style x:Key="{x:Type ScrollBar}" TargetType="{x:Type ScrollBar}">
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Style.Triggers>
            <Trigger Property="Orientation" Value="Horizontal">
                <Setter Property="Width" Value="Auto"/>
                <Setter Property="Height" Value="18" />
                <Setter Property="Template" Value="{StaticResource HorizontalScrollBar}" />
            </Trigger>
            <Trigger Property="Orientation" Value="Vertical">
                <Setter Property="Width" Value="18"/>
                <Setter Property="Height" Value="Auto" />
                <Setter Property="Template" Value="{StaticResource VerticalScrollBar}" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="{x:Type RadioButton}" TargetType="{x:Type RadioButton}">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RadioButton}">
                    <BulletDecorator Background="Transparent">
                        <BulletDecorator.Bullet>
                            <Grid
                                Width="15" 
                                Height="15" >
                                <Ellipse x:Name="Border"  
                                    Fill="{StaticResource NormalBrush}"/>
                                <Ellipse x:Name="CheckMark"
                                    Margin="5"
                                    Fill="{StaticResource ForegroundBrush}" />
                            </Grid>
                        </BulletDecorator.Bullet>
                        <ContentPresenter
                            Margin="4 0 0 0"
                            VerticalAlignment="Center"
                            HorizontalAlignment="Left"
                            RecognizesAccessKey="True"/>
                    </BulletDecorator>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="false">
                            <Setter TargetName="CheckMark" Property="Visibility" Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="Border" Property="Fill" Value="{StaticResource MouseOverBrush}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="Border" Property="Fill" Value="{StaticResource ActiveBrush}" />
                            <Setter TargetName="CheckMark" Property="Fill" Value="{StaticResource WhiteBrush}"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter TargetName="Border" Property="Fill" Value="{StaticResource DisabledBrush}" />
                            <Setter Property="Foreground" Value="{StaticResource DisabledBrush}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type ContextMenu}">
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="True"/>
        <Setter Property="Grid.IsSharedSizeScope" Value="true"/>
        <Setter Property="Foreground" Value="{StaticResource ForegroundBrush}"/>
        <Setter Property="HasDropShadow" Value="True"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ContextMenu">
                    <Border x:Name="Border"
                            Background="{StaticResource NormalBrush}"
                            BorderBrush="{StaticResource ActiveBrush}"
                            BorderThickness="1">
                        <StackPanel
                            IsItemsHost="True"
                            KeyboardNavigation.DirectionalNavigation="Cycle"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="HasDropShadow" Value="true">
                            <Setter TargetName="Border" Property="Padding" Value="0,3,0,3"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type MenuItem}">
        <Setter Property="OverridesDefaultStyle" Value="True"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type MenuItem}">
                    <Border Name="Border">
                        <Grid>
                            <ContentPresenter
                                Margin="10 2"
                                Width="100"
                                ContentSource="Header"
                                RecognizesAccessKey="True"/>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="Border" Property="Background" Value="{StaticResource MouseOverBrush}"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="Border" Property="Background" Value="{StaticResource ActiveBrush}"/>
                            <Setter Property="Foreground" Value="{StaticResource WhiteBrush}"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Foreground" Value="{StaticResource DisabledBrush}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>